package org.wiw.server;

import java.util.List;

import javax.jdo.PersistenceManager;
import javax.jdo.Query;

import org.wiw.server.model.Person;

public class DBManager {

	public static List<Person> getAllPersons() {
		PersistenceManager pm = PMF.get().getPersistenceManager();
		Query query = pm.newQuery(Person.class);
		//query.setFilter("lastName == lastNameParam");
		query.setOrdering("nickname");
		//query.declareParameters("String lastNameParam");
		try {
		    return (List<Person>) query.execute();
		} finally {
		    query.closeAll();
		}
	} 
}
